package com.wlr.blog.web.common.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * 
 * @TableName album
 */
@TableName(value ="album")
@Data
public class Album implements Serializable {
    /**
     * 
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 相册banner
     */
    private String albumCover;

    /**
     * 相册标题
     */
    private String albumTitle;

    /**
     * 相册描述
     */
    private String albumDesc;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Album other = (Album) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getAlbumCover() == null ? other.getAlbumCover() == null : this.getAlbumCover().equals(other.getAlbumCover()))
            && (this.getAlbumTitle() == null ? other.getAlbumTitle() == null : this.getAlbumTitle().equals(other.getAlbumTitle()))
            && (this.getAlbumDesc() == null ? other.getAlbumDesc() == null : this.getAlbumDesc().equals(other.getAlbumDesc()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getAlbumCover() == null) ? 0 : getAlbumCover().hashCode());
        result = prime * result + ((getAlbumTitle() == null) ? 0 : getAlbumTitle().hashCode());
        result = prime * result + ((getAlbumDesc() == null) ? 0 : getAlbumDesc().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", albumCover=").append(albumCover);
        sb.append(", albumTitle=").append(albumTitle);
        sb.append(", albumDesc=").append(albumDesc);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}